import groovy.xml.MarkupBuilder

/**
 * Created with IntelliJ IDEA.
 * User: eric
 * Date: 4/25/14
 * Time: 6:11 PM
 * To change this template use File | Settings | File Templates.
 */


class MetaTest {

    def name = 'mt'

    def storage = [:]

    def propertyMissing(String name, value) { storage[name] = value }
    def propertyMissing(String name) { storage[name] }
}

class MarkupBuilderCategory{
    def static lookupNode(MarkupBuilder builder, map) {

    }
}


//MetaTest.metaClass.getProperty = {
//    meta = MetaTest.metaClass.getMetaProperty(it)
//    if (meta) {
//        meta.getProperty(delegate)
//    } else {
//        "hello?"
//    }
//}


def map = ["node1":"value1", "node2":"value2"]
def builder = new MarkupBuilder()
use(MarkupBuilderCategory) {
    builder.node1{
        node12("hello")
    }
}





